//
//  MapLayer.m
//  cocos2dHelloWord
//
//  Created by 勤信为诚 on 11-9-26.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "MapLayer.h"


@implementation MapLayer



-(id) init{
    self=[super init];
    if(self)
    {
    CCTMXTiledMap* gameWorld = [CCTMXTiledMap tiledMapWithTMXFile:@"isometric_grass_and_water.tmx"]; [self addChild:gameWorld z:0 tag:9];
    }
    return self;
}

-(void) registerWithTouchDispatcher{
    [[CCTouchDispatcher sharedDispatcher] addTargetedDelegate:self priority:INT_MIN+1 swallowsTouches:YES];
    
}

-(void)ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{

    UITouch *touch=[touches anyObject];
    CGPoint touchPoint=[touch locationInView:[touch view]];

    touchPoint=[[CCDirector sharedDirector] convertToGL:touchPoint];
    
}

/*-(void) OnMapAction:(MapAction)kt{
    
   CCNode *gamemapnode= [self getChildByTag:9];
    CCTMXTiledMap *gameMap=(CCTMXTiledMap*)gamemapnode;
    float mapY=gameMap.position.y;
    float mapX=gameMap.position.x;
    switch (kt) {
        case kUp:
            mapY=mapY-2;
            break;
            case kDown:
            mapY=mapY+2;
            break;
            case kLeft:
            mapX=mapX+2;
            break;
            case kRight:
            mapX=mapX-2;
        default:
            break;
    }

    if(mapX > 0) mapX = 0; 
    if(mapY > 0) mapY = 0;
}*/
@end
